package com.um.swing.ui;

import com.um.swing.common.inc.CreateCursor;

import javax.swing.*;
import javax.swing.plaf.basic.BasicLabelUI;
import java.awt.*;

/**
 * 底部点位信息UI
 * 2022年04月26日13:08:58
 * 袁泉
 */
public class IBottomPointLabelUI extends BasicLabelUI {


    @Override
    public void installUI(JComponent c) {
        super.installUI(c);
        JLabel label = (JLabel) c;
        c.setCursor(CreateCursor.createIcon("link"));
//        bpane.setBackground(Config.MAIN_BG_COLOR_C);
//        bpane.setPreferredSize(new Dimension(c.getWidth(), Config.TOOL_BAR_HEIGHT));
//        bpane.setLayout(new FlowLayout(5, 10, FlowLayout.LEFT));
    }


    @Override
    public void paint(Graphics g, JComponent c) {
        super.paint(g, c);
        Graphics2D g2d = (Graphics2D) g;
        //消除文字锯齿
        g2d.setRenderingHint(RenderingHints.KEY_TEXT_ANTIALIASING, RenderingHints.VALUE_TEXT_ANTIALIAS_ON);
        //消除画图锯齿
        g2d.setRenderingHint(RenderingHints.KEY_ANTIALIASING, RenderingHints.VALUE_ANTIALIAS_ON);
        g2d.setStroke(new BasicStroke(3));
        g2d.drawLine(10, c.getHeight(), c.getWidth(), c.getHeight());

    }

}
